# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dirbuster
pkgver=1.0_RC1
pkgrel=11
groups=('blackarch' 'blackarch-scanner' 'blackarch-webapp')
pkgdesc="An application designed to brute force directories and files names on web/application servers"
url='http://www.owasp.org/index.php/Category:OWASP_DirBuster_Project'
license=('LGPL')
arch=('any')
depends=('java-environment')
source=("http://downloads.sourceforge.net/dirbuster/DirBuster-${pkgver/_/-}.tar.bz2")
sha512sums=('0462b14d5bd58ef8ebd4e3b26c8c72f838bb8241de23544f548f4f55bf8bccf23b49dc05eb7c23e15dc601ccc267f71bb93c43b66f0f7a89a834433b35ba1c1f')

package() {
  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp --no-preserve=ownership -a DirBuster-${pkgver/_/-}/* \
    "$pkgdir/usr/share/$pkgname"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/DirBuster-${pkgver/_/-}.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

